package com.longxi.tianjintianbao.ui.adapter.multitype;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.model.ProgressLabel;

import me.drakeet.multitype.ItemViewBinder;

/**
 * Created by cxw on 2018/2/20.
 */
public class ProgressLabelViewBinder extends ItemViewBinder<ProgressLabel, ProgressLabelViewBinder.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View root = inflater.inflate(R.layout.item_task_progress_label, parent, false);
        return new ViewHolder(root);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull ProgressLabel progressLabel) {
        holder.mTvTaskProgress.setText(progressLabel.getName() + "进度:" + progressLabel.getState());
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        LinearLayout mLlBtn;
        TextView mTvTaskProgress;
        ViewHolder(View itemView) {
            super(itemView);
            mLlBtn = itemView.findViewById(R.id.llBtn);
            mTvTaskProgress = itemView.findViewById(R.id.tvTaskProgress);
        }
    }
}
